home *** CD-ROM | disk | FTP | other *** search
/ 600 Games / 600games.iso / Nave / spaceambush.swf / scripts / frame_286 / PlaceObject2_242_26 / CLIPACTIONRECORD onClipEvent(mouseMove).as
Encoding:
Text File  |  2007-03-12  |  333 b   |  17 lines

  1. onClipEvent(mouseMove){
  2.    x = this._xmouse;
  3.    y = this._ymouse * -1;
  4.    angle = Math.atan(y / x) / 0.017453292519943295;
  5.    if(x < 0)
  6.    {
  7.       angle += 180;
  8.    }
  9.    if(x >= 0 && y < 0)
  10.    {
  11.       angle += 360;
  12.    }
  13.    _root.angletext = angle;
  14.    _root.tank.turret._rotation = angle * -1;
  15.    updateAfterEvent();
  16. }
  17.